import com.beans.*;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * Created with IntelliJ IDEA.
 * User:xieChao
 * Date:2022/11/28 19:53
 */
public class App {
    public static void main(String[] args) {
        ApplicationContext context = new ClassPathXmlApplicationContext("spring-config.xml");
//       UserController controller = context.getBean("userController",UserController.class);
//       controller.sayHi();
//        UserService service = context.getBean("userService",UserService.class);
//        service.sayHi();
//        UserRepository repository = context.getBean("userRepository",UserRepository.class);
//        repository.sayHi();
//        UserConfiguration configuration = context.getBean("userConfiguration",UserConfiguration.class);
//        configuration.sayHi();
//        UserComponent component = context.getBean("userComponent",UserComponent.class);
//        component.sayHi();
//        User user = context.getBean("u2" , User.class);
//        System.out.println(user);
//       UserController userController = context.getBean("userController",UserController.class);
//       userController.sayHi();
        UserController2 controller2 = context.getBean("userController2",UserController2.class);
        controller2.sayHi();
    }
}